package com.han.yrpc.demo.consumer;

import com.han.yrpc.core.consumer.YrpcConsumer;
import com.han.yrpc.demo.api.person.Person;
import com.han.yrpc.demo.api.person.PersonApi;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class PersonService {

    @YrpcConsumer
    private PersonApi personApi;

    List<Person> persons() {
        return personApi.persons();
    }

    Person getPersonById(Integer id) {
        return personApi.getPersonById(id);
    }
}
